﻿<Window
	x:Class="ICSharpCode.AspNet.Mvc.AddMvcControllerToProjectView"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:core="http://icsharpcode.net/sharpdevelop/core"
	xmlns:mvc="clr-namespace:ICSharpCode.AspNet.Mvc"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	Title="Add Controller"
	Style="{x:Static core:GlobalStyles.DialogWindowStyle}"
	mvc:CloseWindowBehaviour.IsClosed="{Binding IsClosed}"
	WindowStartupLocation="CenterOwner"
	FocusManager.FocusedElement="{Binding ElementName=ControllerNameTextBox}"
	Height="400"
	Width="500">
	
	<Window.Resources>
		<Style TargetType="Button" BasedOn="{x:Static core:GlobalStyles.ButtonStyle}"/>
		<DataTemplate x:Key="ControllerTemplate">
			<TextBlock Text="{Binding Description}"/>
		</DataTemplate>
	</Window.Resources>
	
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
			<RowDefinition Height="Auto"/>
		</Grid.RowDefinitions>
		
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto"/>
			<ColumnDefinition Width="*"/>
		</Grid.ColumnDefinitions>
	
		<TextBlock
			Margin="4"
			Text="Controller Name:"/>
		<TextBox
			x:Name="ControllerNameTextBox"
			Grid.Column="1"
			Text="{Binding Path=ControllerName, UpdateSourceTrigger=PropertyChanged}"/>
	
		<TextBlock
			Grid.Row="1"
			Margin="4"
			Text="Template:"/>
		<ComboBox
			Margin="2"
			Grid.Column="1"
			Grid.Row="1"
			ItemsSource="{Binding Path=ControllerTemplates}"
			ItemTemplate="{StaticResource ControllerTemplate}"
			SelectedItem="{Binding Path=SelectedControllerTemplate}"/>
		
		<StackPanel
			Orientation="Horizontal"
			HorizontalAlignment="Right"
			Margin="4"
			Grid.Column="0"
			Grid.ColumnSpan="2"
			Grid.Row="3">
			<Button
				Margin="2, 0"
				Content="_Add"
				IsDefault="True"
				Command="{Binding Path=AddMvcControllerCommand}"/>
			<Button
				Margin="2, 0"
				Content="_Cancel"
				IsCancel="True"/>
		</StackPanel>
	</Grid>
</Window>